<include file="Public:head" />


<div class="table_box">
  <!-- 筛选 -->
  <form class="layui-form" style="margin-bottom: 20px;">
    <fieldset class="layui-elem-field layui-field-title">
      <legend>修改密码</legend>
      <div class="layui-field-box">


        <div class="layui-form-item" style="margin-top:20px;">
          <label class="layui-form-label">当前密码</label>
          <div class="layui-input-inline">
            <input type="password" name="password_old" id="password_old" autocomplete="off"  class="layui-input">
          </div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">新密码</label>
          <div class="layui-input-inline">
            <input type="password" name="password_new" id="password_new"  autocomplete="off"  class="layui-input">
          </div>
          <div class="layui-form-mid layui-word-aux">请填写6到12位密码</div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">确认新密码</label>
          <div class="layui-input-inline">
            <input type="password" name="password_new2" id="password_new2"  autocomplete="off"  class="layui-input">
          </div>

        </div>

      </div>
    </fieldset>
  </form>
  <!--  -->
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn " onclick="sub()">确认修改</button>
    </div>
  </div>


<include file="Public:foot" />



<!-- ---------------------------------------------------------------- -->



<script>

//确定-提交
function sub(){
  var password_old = $('#password_old').val();
  var password_new = $('#password_new').val();
  var password_new2 = $('#password_new2').val();

  if(password_old == ''){
      layer.msg('当前密码不能为空',{
        time:900  ,           //时间
        offset: '100px' 
      });
      
      $('#password_old').css('border','1px solid #ff0000');
      var timer = setTimeout(function () {
            $('#password_old').css('border','1px solid #e6e6e6');
      },1000);
      return false;
  }

  if(password_new == ''){
      layer.msg('新密码不能为空',{
        time:900  ,           //时间
        offset: '100px'
      });
      
      $('#password_new').css('border','1px solid #ff0000');
      var timer = setTimeout(function () {
            $('#password_new').css('border','1px solid #e6e6e6');
      },1000);
      return false;
  }

    if(password_new2 == ''){
      layer.msg('确认新密码不能为空',{
        time:900  ,           //时间
        offset: '100px'
      });
      $('#password_new2').css('border','1px solid #ff0000');
      var timer = setTimeout(function () {
            $('#password_new2').css('border','1px solid #e6e6e6');
      },1000);
      return false;
  }
  if(password_new != password_new2){
      layer.msg('新密码前后输入不一致',{
        time:900  ,           //时间
        offset: '100px'
      });
      
      $('#password_new').css('border','1px solid #ff0000');
      $('#password_new2').css('border','1px solid #ff0000');
      var timer = setTimeout(function () {
            $('#password_new').css('border','1px solid #e6e6e6');
            $('#password_new2').css('border','1px solid #e6e6e6');
      },1000);
      return false;
  }
  
  $.ajax({
      type:"get",
      url:"__APP__/password/edit",
      data:"password_old="+password_old+"&password_new="+password_new,

      success:function(data){
      	// alert(data);
        returnInfo(data);

      }        
  })//ajax结束
}

</script>



<!-- ---------------------------------------------------------------- -->



<script id="box">
  <style>
    .layui-input-item{
      margin-bottom: 15px;
    }
  </style>
  <form class="layui-form" id="add_edit" action="" style="margin:15px;">
    <!-- 隐藏域 -->
    <input type="hidden" name="id" class="editId">
    <input type="hidden" name="type" class="typeId">


    <fieldset class="layui-elem-field">
      <legend style='color:#009688;font-size:14px'>基本信息</legend>
      <div class="layui-field-box">

      <div class="layui-form-item" style="">
        <!-- 文本输入 -->
        <label class="layui-form-label"><span style="color:red">*</span> 角色名</label>
        <div class="layui-input-inline">
          <input type="text" id="groupname" name="groupname" placeholder="请输入账号名" class="layui-input" >
        </div>
        <!-- 下拉选框 -->
        <label class="layui-form-label"><span style="color:red">*</span> 状态</label>
        <div class="layui-input-inline">
          <select name="status" id="status">
            <option value="1">开启</option>
            <option value="0">关闭</option>
          </select>
        </div>
      </div> 

      <!-- 普通文本域 -->  
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">角色描述</label>
        <div class="layui-input-block">
          <textarea placeholder="请输入内容" name='des' class="layui-textarea" style="width:90%;height:50px;" id="des"></textarea>
        </div>
      </div>


      </div>
    </fieldset>

    <fieldset class="layui-elem-field">
      <legend style='color:#009688;font-size:14px'>角色权限</legend>
      <div class="layui-field-box">

      <!-- 多选框 -->
      <foreach name="qx_list" key="k" item="v">
        <div class="layui-form-item">
          <label class="layui-form-label">{$v.remark}</label>
          <div class="layui-input-block">

          	<foreach name="v['data']" key="kk" item="vv">
	            <input type="checkbox" id="qx{$vv.id}"  name="qx[{$vv.id}]" title="{$vv.jurisdiction}" lay-skin="primary">
	        </foreach>

	            
            
          </div>
        </div>

      </foreach>

      </div>
    </fieldset>


    <!-- 按钮 -->
    <div class="layui-form-item" style="margin:20px auto;width:150px;">
      <a class="layui-btn" onclick="sub()">确定</a>
      <button class="layui-btn layui-btn-primary" >取消</button>
    </div>
  </form>
</div>
</script>

